using Android.Content;

namespace MAUILL.PageModels;

public partial class ProjectListPageModel
{
    partial void OpenToutiao(string url)
    {
        var context = Android.App.Application.Context;
        var pm = context.PackageManager;
        var intent = pm.GetLaunchIntentForPackage(url);
        if (intent != null)
        {
            intent.AddFlags(ActivityFlags.NewTask);
            context.StartActivity(intent);
            Preferences.Set(MauiProgram.FirstLaunchKey, url);

        }
    }
}